﻿
@{
   ViewData["Title"] = "DoctorIndex";
    Layout = null;
}
<h2>欢迎回来 你好医生</h2>
<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

<head>


    <link href="~/BootstrapS/css/bootstrap.min14ed.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/font-awesome.min93e3.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/animate.min.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/style.min862f.css" rel="stylesheet" />

    <script src="~/vue/axios.min.js"></script>
    <script src="~/vue/qs.min.js"></script>
    <script src="~/vue/vue.min.js"></script>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight" id="divs">
        <div class="row">

            <div class="ibox-title">
                <input type="text" placeholder="请输入关键词" class="input-sm form-control" style="width:180px;height:34px" v-model="doctor_Name.name">
                <button class="btn btn-info " type="button" style="margin-left:190px;margin-top:-35px" v-on:click="queryDoctor">
                    <i class="fa fa-paste"></i> 查询
                </button>
            </div>



            <div class="ibox float-e-margins">

                <div class="ibox-title">
                    <button type="button" class="btn btn-outline btn-info" data-toggle="modal" data-target="#myModalAdd" href="/Doctor/DoctorAdd">医生登记</button>
@*                    <button type="button" class="btn btn-outline btn-info" data-toggle="modal" data-target="#myModalUpdate" href="/Doctor/DoctorUpdate">编辑信息</button>
*@                    @*<button type="button" class="btn btn-outline btn-info" data-toggle="modal" data-target="#myModal">查看详情</button>*@
                </div>

                <div class="ibox-content">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>编号</th>
                                <th>医生名称</th>
                                <th>性别</th>
                                <th>医龄</th>
                                <th>所属科室</th>
                                <th>职称</th>
                                <th>联系方式</th>
                                <th>当前状态</th>
                            </tr>
                        </thead>

                        <tr v-for="item in doctor">
                            <td>{{item.doctor_Id}}</td>
                            <td>{{item.doctor_number}}</td>
                            <td>{{item.doctor_Name}}</td>
                            <td>{{item.doctor_Sex}}</td>
                            <td>{{item.doctor_Age}}</td>
                            <td>{{item.outpatient_Name}}</td>
                            <td>{{item.professional_Name}}</td>
                            <td>{{item.doctor_Iphone}}</td>
                            <td>{{item.doctor_State==1?"未出诊":item.doctor_State==2?"待出诊":item.doctor_State==3?"已出诊":"已出诊"}}</td>
                            <td>

@*                                <button type="button" class="btn btn-outline btn-warning" href="/Doctor/DoctorUpdate" style="margin-right:10px" data-toggle="modal" v-on:click="updatedoctor(item.doctor_Id)" data-target="#myPatient">编辑信息</button>
*@
@*                                <button type="button" class="btn btn-outline btn-info" data-toggle="modal" data-target="#myModalUpdate" href="/Doctor/DoctorUpdate"  v-on:click="updatedoctor(item.doctor_Id)" >编辑信息</button>
*@
                                <button type="button" class="btn btn-outline btn-info" data-toggle="modal" data-target="#myModal">查看详情</button>
                            </td>

                        </tr>

                    </table>
                    <div class="btn-group" style="margin-left:45%">
                        <button type="button" class="btn btn-white">
                            <i class="fa fa-chevron-left"></i>
                        </button>

                        <button type="button" class="btn btn-white">
                            <i class="fa fa-chevron-right"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <!-- 模态框（Modal） 医生详情-->
    <div class="modal fade animated flipInY" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width:600px;margin-left:70px">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size:30px">&times;</button>
                    <h3 class="modal-title" id="myModalLabel">医生详情信息</h3>
                </div>
                <div>
                    <div style="width:45%;float:left;margin-left:20px;margin-top:15px">
                        <table>
                            <tr>
                                <td colspan="2"></td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"></td>
                                <td>曹操</td>
                            </tr>
                            <tr>
                                <td colspan="2"></td>
                                <td>
                                    <input id="Button1" type="button" value="删除档案" style="color:red" />

                                    <input id="Button2" type="button" value="编辑档案" style="color:green" />
                                </td>
                            </tr>

                        </table>

                    </div>
                    <div style="width:45%;float:right;margin-left:10px;margin-top:15px">
                        姓名
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        医龄
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        性别
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        家庭住址
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        联系方式
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        出生日期
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />
                        邮箱
                        <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                        <br /><br />

                    </div>

                </div>
                <div class="modal-footer">
                    <div>
                        <button type="button" class="btn btn-outline btn-default" data-dismiss="modal">退出</button>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>



    <!-- 模态框（Modal） 医生编辑-->
    <div class="modal fade animated flipInY" id="myModalUpdate" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width:600px;margin-left:70px">

             @*医生编辑模态框*@
                <div>
                    @*<div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size:30px">&times;</button>
            <h3 class="modal-title" id="myModalLabel">编辑医生信息</h3>
        </div>
        <div>
            <div style="width:45%;float:left;margin-left:20px;margin-top:15px">
                医生
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                医龄
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                邮箱地址
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                职称
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />


            </div>
            <div style="width:45%;float:right;margin-left:10px;margin-top:15px">
                身份证号
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                出生日期
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                所属科室
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />
                联系方式
                <input type="search" class="form-control input-sm" aria-controls="DataTables_Table_0" style="width:240px">
                <br /><br />

            </div>
        </div>
        <div class="modal-footer">
            <div>
                <button type="button" class="btn btn-outline btn-default" data-dismiss="modal">退出</button>
                <button type="button" class="btn btn-outline btn-warning">提交</button>
            </div>
        </div>*@
                </div>
               

            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

 

    <!-- 模态框（Modal） 医生登记-->
    <div class="modal fade animated flipInY" id="myModalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width:800px">

            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</body>
</html>
<script src="~/BootstrapS/js/jquery.min.js"></script>
<script src="~/BootstrapS/js/bootstrap.min.js"></script>
<script src="~/BootstrapS/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="~/BootstrapS/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="~/BootstrapS/js/plugins/layer/layer.min.js"></script>
<script src="~/BootstrapS/js/hplus.min.js"></script>
<script src="~/BootstrapS/js/contabs.min.js"></script>
<script src="~/BootstrapS/js/plugins/pace/pace.min.js"></script>



<script>

    new Vue({
        el: '#divs',

        data() {
            return {
                doctor_Name: {
                    name: ""
                },
                doctor: null
            }
        },
        mounted() { //是首次加载
            function gpf() {
                return axios
                    .get('/Doctor/GetProfessionals');
            }
            function got() {
                return axios
                    .get('/Doctor/GetOutpatient')
            }
            axios.all([got(), gpf()])

                .then(axios.spread((pfls, opts) => {
                    this.pfl = pfls.data;
                    this.opt = opts.data;

                }))
                .catch(err => {
                    console.log(err);
                })
            axios
                .get('/Doctor/GetDoctorsLists')
                .then(response => (this.doctor = response.data))
                .catch(function (error) { // 请求失败处理
                    console.log(error);
                })
        },

      

        methods: {   //是方法  

            queryDoctor: function () {

                axios
                    .get('/Doctor/GetDoctorsLists', {

                        params: { Doctorname: this.doctor_Name.name }
                    })
                    .then(response => (this.doctor = response.data))
                    .catch(function (eatch) {
                        console.log(eatch);
                    })
            },


            @*//添加方法;
            adddoctor: function () {
                var obj = {

                    Doctor_Name: this.doctor.Doctor_Name,
                    Doctor_Sex: this.doctor.Doctor_Sex,
                    Doctor_Age: this.doctor.Doctor_Age,
                    Doctor_Iphone: this.doctor.Doctor_Iphone,
                    Doctor_State: this.doctor.Doctor_State,
                    Doctor_number: this.doctor.Doctor_number,
                    Doctor_Home: this.doctor.Doctor_Home,
                    Doctor_IDnumber: this.doctor.Doctor_IDnumber,
                    Doctor_Birthday: this.doctor.Doctor_Birthday,
                    Doctor_Email: this.doctor.Doctor_Email,
                    Doctor_Remark: this.doctor.Doctor_Remark,
                    Doctor_IDnumberPicture: this.doctor.Doctor_IDnumberPicture
                };
                axios
                    .post("/Doctor/AddDoctor", window.Qs.stringify(obj))
                    .then(res => {
                        alert(res.data);
                    })
            },*@

            ///下拉
            SelDoctor: function () {
                axios
                    .get('/Doctor/GetOutpatient', {
                        Doctor_Name: this.SelDoctor
                    })
                    .then(res => (this.users = res.data))
                    .catch(function (error) { // 请求失败处理
                        console.log(error);
                    });
            },

            //获取详情信息id
            updatedoctor: function (did) {
                sessionStorage["did"] = did;
            }

        }

    })
</script>
